﻿Imports System.Collections.Generic
Imports System.Data
Imports Biz
Imports System.Data.SqlClient



Public Class DALDigitoVerificador

    Private Shared m_Instance As DALDigitoVerificador
    Private Shared m_Semaforo As New Object
    Private m_TDGDigitoVerificador As TDGDigitoVerificador


    Public Function EsValido() As Boolean
        Dim bResultado As Boolean
        Dim database As cDatabase

        Try
            database = cDatabase.Instance

            database.Conectar()
            bResultado = m_TDGDigitoVerificador.EsValido(database.Conexion)
            database.Desconectar()

            Return bResultado

        Catch ex As Exception
            Throw New Excepciones.BusquedaFalloBuscar(ex)
        End Try

    End Function

    Public Shared Function Instance() As DALDigitoVerificador
        If m_Instance Is Nothing Then
            SyncLock (m_Semaforo)
                If m_Instance Is Nothing Then
                    m_Instance = New DALDigitoVerificador
                End If
            End SyncLock
        End If

        Return m_Instance
    End Function

    Private Sub New()
        m_TDGDigitoVerificador = TDGDigitoVerificador.Instance()
    End Sub

End Class
